package net.lanelife.casino.caipiao.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import net.lanelife.casino.common.entity.annotation.Checked;
import net.lanelife.casino.common.entity.support.CheckableEntity;
import net.lanelife.casino.common.utils.BillNoUtils;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "TB_TRANSFER_RECORD")
public class TransferRecord extends CheckableEntity<Integer> {

	private static final long serialVersionUID = 5490910421051324818L;

	@Checked
	@Column(name = "BILLNO", length = 24, nullable = false)
	private String billNo = BillNoUtils.generateBillNo(BillNoUtils.PREFIX_ZZ);

	@Checked
	@Column(name = "AMOUNT", nullable = false)
	private Double amount;

	@Checked
	@Column(name = "FEE", nullable = false)
	private Double fee = 0D;

	@Checked
	@Enumerated(EnumType.ORDINAL)
	@Column(name = "STATUS", nullable = false)
	private Status status = Status.PENDING;

	@Checked
	@Column(name = "PAYER_USER_ID", nullable = false)
	private Integer payerUserId;

	@Checked
	@Column(name = "PAYER_USER_NAME", length = 16, nullable = false)
	private String payerUserName;

	@Checked
	@Column(name = "PAYEE_USER_ID", nullable = false)
	private Integer payeeUserId;

	@Checked
	@Column(name = "PAYEE_USER_NAME", length = 16, nullable = false)
	private String payeeUserName;

	@Checked
	@Column(name = "POSTSCRIPT", length = 255, nullable = false)
	private String postscript;
	
	@Checked
	@Column(name = "REMARK", length = 255, nullable = false)
	private String remark;

	public static enum Status {
		PENDING, ACCEPTED, REJECTED, CANCELLED
	}

	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}

	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public Double getFee() {
		return fee;
	}

	public void setFee(Double fee) {
		this.fee = fee;
	}

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	public Integer getPayerUserId() {
		return payerUserId;
	}

	public void setPayerUserId(Integer payerUserId) {
		this.payerUserId = payerUserId;
	}

	public String getPayerUserName() {
		return payerUserName;
	}

	public void setPayerUserName(String payerUserName) {
		this.payerUserName = payerUserName;
	}

	public Integer getPayeeUserId() {
		return payeeUserId;
	}

	public void setPayeeUserId(Integer payeeUserId) {
		this.payeeUserId = payeeUserId;
	}

	public String getPayeeUserName() {
		return payeeUserName;
	}

	public void setPayeeUserName(String payeeUserName) {
		this.payeeUserName = payeeUserName;
	}

	public String getPostscript() {
		return postscript;
	}

	public void setPostscript(String postscript) {
		this.postscript = postscript;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
